package com.imooc.dataobject;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.NotNull;

import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * product_info
 * @author 
 */
@Entity
@DynamicUpdate
@Data
public class ProductInfo implements Serializable {
    @Id
    private String productId;

    /**
     * 商品名称
     */
    @NotEmpty
    private String productName;

    /**
     * 单价
     */
    @NotNull
    private BigDecimal productPrice;

    /**
     * 库存
     */
    @NotNull
    private Integer productStock;

    /**
     * 描述
     */
    private String productDescription;

    /**
     * 小图
     */
    private String productIcon;

    /**
     * 商品状态,0正常1下架
     */
    private Integer productStatus;

    /**
     * 类目编号
     */
    @NotNull
    private Integer categoryType;

    private static final long serialVersionUID = 1L;

    public ProductInfo() {
    }

    public ProductInfo(String productId, String productName, BigDecimal productPrice, Integer productStock, String productDescription, String productIcon, Integer productStatus, Integer categoryType) {
        this.productId = productId;
        this.productName = productName;
        this.productPrice = productPrice;
        this.productStock = productStock;
        this.productDescription = productDescription;
        this.productIcon = productIcon;
        this.productStatus = productStatus;
        this.categoryType = categoryType;
    }
}